@extends('admin.layout.main')
@section('content')
    <div class="layui-tab layui-tab-brief" lay-filter="demoTitle">
        <ul class="layui-tab-title site-demo-title">
            <li class="layui-this"><a href="javascript:location.reload()">会员管理</a></li>
        </ul>
        <div class="layui-body layui-tab-content site-demo site-demo-body">
            <div class="layui-main">
                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                    <legend>筛选</legend>
                </fieldset>
                <form class="layui-form" action="/admin/users" method="get">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">用户名</label>
                            <div class="layui-input-inline">
                                <input type="text" name="name" lay-verify="required" autocomplete="off" class="layui-input"
                                       placeholder="请输入用户名" value="">
                            </div>
                        </div>
                        <div class="layui-inline">

                            <button class="layui-btn" lay-submit="" lay-filter="demo1">搜索</button>
                            <a class="layui-btn" href="/admin/users/create">添加</a>
                        </div>
                    </div>
                </form>
            </div>
            <div class="layui-tab-item layui-show">
                <div class="layui-main">
                    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
                        <legend>会员管理</legend>
                    </fieldset>
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>用户名</th>
                            <th>创建时间</th>
                            <th>修改时间</th>
                            <th width="130">操作</th>
                        </tr>
                        </thead>
                        @foreach($users as $user)
                        <tr>
                            <td>{{$user->id}}</td>
                            <td>{{$user->name}}</td>
                            <td>{{$user->created_at}}</td>
                            <td>{{$user->updated_at}}</td>
                            <td><a class="layui-btn layui-btn-normal"
                                   href="/admin/users/{{$user->id}}/role">角色管理</a>
                            </td>
                        </tr>
                        @endforeach
                    </table>
                    {{$users->links()}}
                </div>
            </div>
        </div>
    </div>
@endsection
<script>

</script>
